<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:pe="http://primefaces.org/ui/extensions">

    <body>
        <ui:composition template="/WEB-INF/templates/newMainCandidateTemplate.xhtml">
            <ui:define name="content">
                <h:outputStylesheet library="css" name="candidate/candidate.css"></h:outputStylesheet>
                <h:outputStylesheet library="css" name="candidate/candidate_desktop.css" media="screen and (min-width:1025px) and (max-width:1600px)"></h:outputStylesheet>
                <h:outputStylesheet library="css" name="candidate/candidate_desktop_wide.css" media="screen and (min-width : 1601px)"></h:outputStylesheet>
                <h:outputStylesheet library="css" name="candidate/candidate_tablet.css" media="screen and (min-device-width : 768px) and (max-device-width : 1024px), screen and (max-width:1024px)"></h:outputStylesheet>
                <h:outputStylesheet library="css" name="candidate/candidate_smartphone.css" media="screen and (min-device-width : 320px) and (max-device-width : 767px), screen and (max-width:767px)"></h:outputStylesheet>
                
                
                <h:form id="professionalForm">
                    <p:growl id="professionalGrowl"></p:growl>
                    <p:panel id="editProfessionalPanel" styleClass="noPaddingTopTitle noMargin noBorder marginTopBar" header="#{messages.Professional}">
                        <f:event listener="#{newEditCandidateBean.validateExperienceFinishDateDialog}" type="postValidate" />
                        <p:selectOneMenu required="true" styleClass="width100" filter="true" filterMatchMode="contains" requiredMessage="#{messages.SectorRequired}" converter="#{sectorConverter}" id="editSelectProfessionalSector"  value="#{newEditCandidateBean.collectorProfessionalInfo.sector}" effect="fade" label="#{messages.Sector}">  
                            <f:selectItem itemLabel="#{messages.Sector}" itemValue="" />  
                            <f:selectItems value="#{userResourcesBean.sectors}" var="sector" itemLabel="#{sectorBundle[sector.idSector.toString()]}" itemValue="#{sector}"/>
                        </p:selectOneMenu>
                        
                        <p:inputText styleClass="width100" required="true" requiredMessage="#{messages.CompanyRequired}" id="companyEdit" value="#{newEditCandidateBean.collectorProfessionalInfo.company}" label="#{messages.Company}">  
                            <f:validateLength maximum="100"></f:validateLength>
                        </p:inputText>  
                        <p:watermark for="companyEdit" value="#{messages.Company}" />

                        <p:selectOneMenu styleClass="width100" filter="true" filterMatchMode="contains" required="true" requiredMessage="#{messages.JobPositionRequired}" converter="#{jobPositionConverter}" id="editSelectJobPosition"  value="#{newEditCandidateBean.collectorProfessionalInfo.jobPosition}" effect="fade" label="#{messages.JobPosition}">  
                            <f:selectItem itemLabel="#{messages.JobPosition}" itemValue="" />  
                            <f:selectItems value="#{userResourcesBean.jobPositions}" var="jobPosition" itemLabel="#{jobPositionBundle[jobPosition.idJobPosition.toString()]}" itemValue="#{jobPosition}"/>
                        </p:selectOneMenu>

                        <p:selectOneMenu styleClass="width100" required="true" requiredMessage="#{messages.JobDurationRequired}" converter="#{jobDurationConverter}" id="editSelectJobDuration"  value="#{newEditCandidateBean.collectorProfessionalInfo.jobDuration}" effect="fade" label="#{messages.JobDuration}">  
                            <f:selectItem itemLabel="#{messages.JobDuration}" itemValue="" />  
                            <f:selectItems value="#{userResourcesBean.jobDurations}" var="jobDuration" itemLabel="#{jobDurationBundle[jobDuration.idJobDuration.toString()]}" itemValue="#{jobDuration}"/>  
                        </p:selectOneMenu>

                        <p:calendar  mindate="1/1/1950" yearRange="c-50:c+50" pattern="dd/MM/yyyy" maxdate="1/1/2050" styleClass="width100 inputCalendar" locale="es" value="#{newEditCandidateBean.collectorProfessionalInfo.startDate}" navigator="true" required="true" id="editStartDateProfessional" requiredMessage="#{messages.StartDateRequired}" label="#{messages.StartDate}">
                        </p:calendar>
                        <p:watermark for="editStartDateProfessional" value="#{messages.StartDate} (dd/mm/yyyy)" />

                        <p:calendar  mindate="1/1/1950" yearRange="c-50:c+50" pattern="dd/MM/yyyy"  styleClass="width100 inputCalendar" locale="es" value="#{newEditCandidateBean.collectorProfessionalInfo.finishDate}" navigator="true" required="false" id="editFinishDateProfessional" requiredMessage="#{messages.FinishDateRequired}" label="#{messages.FinishDate}">
                        </p:calendar>
                        <p:watermark for="editFinishDateProfessional" value="#{messages.FinishDate} (dd/mm/yyyy)" />
                        
                        <div style="margin-bottom:0.7em!important;font-size: 115%;">
                            <p:selectBooleanCheckbox id="workingNowDialog" value="#{newEditCandidateBean.collectorProfessionalInfo.current}" /> 
                            <h:outputText value="#{messages.WorkingNow}" />  
                        </div>

                        <p:inputTextarea autoResize="false" styleClass="width100"  required="false" id="editShortDescription" value="#{newEditCandidateBean.collectorProfessionalInfo.description}" label="#{messages.Description}" maxlength="150" counter="editCounter" counterTemplate="{0} #{messages.CharactersRemaining}" >  
                            <f:validateLength maximum="150"></f:validateLength>
                        </p:inputTextarea>  
                        <p:watermark for="editShortDescription" value="#{messages.DescriptionProfessional}" />
                        <h:outputText styleClass="bodyText block" id="editCounter" />
                        <p:commandButton update=":professionalForm:professionalGrowl" rendered="#{newEditCandidateBean.collectorProfessionalInfo.idCandidateProfessionalInfo==null}" style="margin-bottom: 0.5em;margin-top: 0.5em;" process="@form" actionListener="#{newEditCandidateBean.saveProfessional()}" styleClass="updatePicturesButton formButton grayBackgroundStrong inlineBlock" id="btn_add_dialog" value="#{messages.Add}" action="#{newEditCandidateBean.reditectToProfessionalPanel()}" ></p:commandButton>    
                        <p:commandButton update=":professionalForm:professionalGrowl" rendered="#{newEditCandidateBean.collectorProfessionalInfo.idCandidateProfessionalInfo!=null}" style="margin-bottom: 0.5em;margin-top: 0.5em;" process="@form" actionListener="#{newEditCandidateBean.editProfessional()}" styleClass="grayBackgroundStrong inlineBlock" id="btn_edit" value="#{messages.Edit}"  action="#{newEditCandidateBean.reditectToProfessionalPanel()}"></p:commandButton>
                        <p:commandButton process="@this" styleClass="marginBottom05em marginTop05em grayBackgroundStrong block" id="back_button" value="#{messages.Cancel}"  action="#{newEditCandidateBean.cancelReditectToProfessionalPanel()}"></p:commandButton>
                    </p:panel>
                </h:form>
                
                
            </ui:define>
        </ui:composition>
         
    </body>
</html>
